﻿using System.Windows.Forms;
using Map;
using Map_Creator.MainForm.Controls.MenuStrips;

namespace Map_Creator
{
    public enum NodeType
    {
        Map,
        Layer,
        TileSet,
        DataGrid,
        ObjectLayer,
    }

    public class ExtendedTreeNode : TreeNode
    {
        public NodeType Type;
        public BaseObject Obj;

        public ExtendedTreeNode(string text, NodeType type, BaseObject obj)
            : base(text)
        {
            Type = type;
            Obj = obj;
            
            Initialize();
        }

        private void Initialize()
        {
            switch (Type)
            {
                case NodeType.TileSet:
                case NodeType.DataGrid:
                case NodeType.ObjectLayer:
                case NodeType.Map:
                    {
                        ContextMenuStrip = new MapMenuStrip();
                    }
                    break;
                case NodeType.Layer:
                    {
                        ContextMenuStrip = new LayerMenuStrip();
                    }
                    break;
            }
        }
    }
}